<?php
/**
 * Created by PhpStorm.
 * User: zhangyi
 * Date: 17/3/11
 * Time: 上午10:35
 */
namespace backend\controllers;

use app\models\Focuspic;
use Yii;

class AdController extends BaseInterfaceController
{
    public function actionBanners()
    {
        $models = Focuspic::find()->orderBy('sort desc')->all();
        $data = array();
        foreach($models as $index=>$model) {
            $data[$index] = array(
                'detail'=>$this->safe($model->link),
                'img_url'=>$model->url,
            );
        }
        $this->content = array('list'=>$data);
        return $this->outputJson();

    }
}